package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.IMyCenterFragmentModel;
import com.wgts.wgts.mvp.model.imp.MyCenterFragmentModel;
import com.wgts.wgts.mvp.presenter.IMyCenterFragmentPersenter;
import com.wgts.wgts.mvp.presenter.imp.MyCenterFragmentPersenter;
import com.wgts.wgts.mvp.view.IMyCenterFragmentView;
import com.wgts.wgts.netmodle.NetService;

import dagger.Module;
import dagger.Provides;

/*
 *
 *
 *   data:2018/9/2918:55
 *
 */
@Module
public class MyCenterFragmentModule {
    private IMyCenterFragmentView view;

    public MyCenterFragmentModule(IMyCenterFragmentView view) {
        this.view = view;
    }

    @FragmentScope
    @Provides
    public IMyCenterFragmentView provideView(){
        return view;
    }

    @FragmentScope
    @Provides
    public IMyCenterFragmentModel provideModel(NetService netService){
        return new MyCenterFragmentModel(netService);
    }

    @FragmentScope
    @Provides
    public IMyCenterFragmentPersenter providePresenter(IMyCenterFragmentView view, IMyCenterFragmentModel model){
        return new MyCenterFragmentPersenter(view, model);
    }
}
